package com.szl.yeb.utils;

import com.szl.yeb.common.R;

/**
 * @program: yeb
 * @description: 根据查询结果返回信息工具
 * @author: szl
 * @create: 2022-08-26 09:50
 **/
public class ResponseProcessor {

    public static R<Object> getResWithMsg(Object result, String msg) {
        if (result instanceof Boolean) {
            if ((Boolean) result) {
                return R.okMsg(msg + "成功");
            }
        }

        if (result instanceof Integer) {
            if ((Integer) result > 0) {
                return R.okMsg(msg + "成功");
            }
        }
        return R.errMsg(msg + "失败");
    }
}
